echo off
REM cd C:\Users\cn40742\Documents\kwptest_vector_kmodule\kwptest
set h=%time:~0,2%
set h=%h: =0%

REM set fileDate2=%date:~0,4%%date:~5,2%%date:~8,2%%time:~1,1%%time:~3,2%%time:~6,2%
#set now=%date:~0,4%_%date:~5,2%_%date:~8,2%_%time:~1,1%_%time:~3,2%_%time:~6,2%
set now=%date:~0,4%_%date:~5,2%_%date:~8,2%_%h%_%time:~3,2%_%time:~6,2%
echo now
echo %cd%
echo %~dp0
REM 声明采用UTF-8编码
@chcp 65001
set MY_PROJECT=KCPC
set MY_TOOL=KWP_Python_Tool
set MY_PROJECT_NAME=%MY_PROJECT%_%MY_TOOL%
set LogFolder=Log_%MY_PROJECT_NAME%
set logname=%MY_PROJECT%_%now%.log
echo Running %MY_PROJECT_NAME% at %date% %time%
echo .....
echo.
echo Will open the logfile with notepad++.exe...
if exist %LogFolder% (

   REM @echo "文件夹已存在"

) else (

md %LogFolder%

)

REM <command> 2>&1 | tee <logfile>
REM python2 test_kwp_services.py > %LogFolder%/%logname%
python2 test_kwp_services.py 2>&1 | tee %LogFolder%/%logname%
REM python2 test_kwp_services.py > %LogFolder%/%logname%


@echo.
@echo Test Complete!
@echo Check LogFile: %~dp0%LogFolder%/%logname% 
start Notepad++.exe %~dp0%LogFolder%/%logname%
 
PAUSE